# Contributor: Laurent Bercot <ska-devel@skarnet.org>
# Maintainer: Laurent Bercot <ska-devel@skarnet.org>
pkgname=dnsfunnel
pkgver=0.0.2.0
pkgrel=0
pkgdesc="A small local DNS cache daemon"
url=https://skarnet.org/software/dnsfunnel/
arch="all"
license="ISC"
options="!check"  # no test targets
_skalibs_version=2.14.3
_s6dns_version=2.4.0
makedepends="skalibs-dev>=$_skalibs_version s6-dns-dev>=$_s6dns_version"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://skarnet.org/software/dnsfunnel/dnsfunnel-$pkgver.tar.gz
	dnsfunnel.initd"
install="dnsfunnel.pre-install"

build() {
	./configure \
		--enable-shared \
		--disable-allstatic \
		--prefix=/usr \
		--libexecdir="/usr/lib/$pkgname"
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -D "$srcdir/dnsfunnel.initd" "$pkgdir/etc/init.d/dnsfunnel"
	mkdir -p "$pkgdir/usr/share/doc"
	cp -a "$builddir/doc" "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
e99203c40714db266fe7a12d4ae57a02a00c5688d26bf24494437cfe6c5cdb8ca3af62f69bc224659aa93c0986759f4b7d6d18b2fdca3c9887ffec6d91cc9338  dnsfunnel-0.0.2.0.tar.gz
b34242cbf457a26770e87ea36d2d6169a42367e4a04444a48b7cae3688827c61e93aeafbd1d009b19e327db66723e9a7c161c4a0b1e27fa3746ccf1cd29a5d2e  dnsfunnel.initd
"
